//
//  JYJNetWorkParser.h
//  HappyListen
//
//  Created by 冀永金 on 16/8/17.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import <Foundation/Foundation.h>




typedef void(^successBlock)(id result);
typedef void(^failureBlock)(NSError *error);

typedef NS_ENUM(NSUInteger, JYJResponseStyle) {
    JYJJSON,
    JYJDATA,
    JYJXML,
};

typedef NS_ENUM(NSUInteger, JYJRequestStyle) {
    JYJBodyString,
    JYJBodyJSON,
};

@interface JYJNetWorkParser : NSObject

+(void)GET:(NSString *)url
   andBody:(id)body
 andHeader:(NSDictionary *)headers
andResponse:(JYJResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;

+(void)POST:(NSString *)url
    andBody:(id)body
andBodyStyle:(JYJRequestStyle)bodyStyle
  andHeader:(NSDictionary *)headers
andResponse:(JYJResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;
@end
